Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support platform and architecture conditions #7

Merged
merged 2 commits into from
Sep 11, 2024

Conversation

kasperisager
Copy link
Contributor

This allows packages to import and export modules using Bare.platform, Bare.arch, and Bare.simulator as conditions:

{
  "exports": {
    ".": {
      "darwin": {
        "arm64": "./darwin-arm64.js",
        "x64": "./darwin-x64.js"
      },
      "ios": {
        "arm64": {
          "simulator": "./ios-arm64-simulator.js",
          "default": "./ios-arm64.js"
        },
        "x64": "./ios-x64-simulator.js"
      }
    }
  }
}

The primary use case of these conditions is compiled code such as native addon prebuilds.

@kasperisager kasperisager merged commit 67cffc8 into main Sep 11, 2024
3 checks passed
@kasperisager kasperisager deleted the platform-arch-condition branch September 11, 2024 10:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant